#version 330 core

layout(location = 0) in vec3 aPos;
layout(location = 1) in vec3 aColor;
uniform mat4 projViewMat;
uniform int renderStep;
out vec4 vcolor;
//out vec2 normalizedXY;

void main(){
    gl_Position = projViewMat * vec4(aPos.x, aPos.y, aPos.z, 1.0f);
    vcolor = vec4(aColor,gl_Position.z);          // 已经是投影矩阵 z = mp * (x,y,z,w) = (?,?,zc,wc) 传到着色器为归一化深度值 zn = zc / wc
//    vcolor = vec4(aColor,gl_Position.w);       // 着色器中 gl_Position.w 乘以归一化深度值得到 投影矩阵的 m33 * z + m34
//    normalizedXY = gl_Position.xy / gl_Position.w;      //虽然可以求出采样坐标 得精度不够会导致体绘制变形
//    normalizedXY = normalizedXY + 1.0f;
//    normalizedXY = normalizedXY / 2.0f;
}
